package cn.codeartist.springboot.component.rocketmq.proxy;

import lombok.Data;

/**
 * RocketMQ生产者发送消息封装配置
 *
 * @author 艾江南
 * @date 2020/8/13
 */
@Data
public abstract class RocketMQProducerEntity {

    private String nameSrvAddr;
    private String group;
    private String instanceName;
    private int retryTimesWhenSendFailed = 2;

    public RocketMQProducerEntity nameSrvAddr(String nameSrvAddr) {
        this.nameSrvAddr = nameSrvAddr;
        return this;
    }

    public RocketMQProducerEntity group(String group) {
        this.group = group;
        return this;
    }

    public RocketMQProducerEntity instanceName(String instanceName) {
        this.instanceName = instanceName;
        return this;
    }

    public RocketMQProducerEntity retryTimesWhenSendFailed(int retryTimesWhenSendFailed) {
        this.retryTimesWhenSendFailed = retryTimesWhenSendFailed;
        return this;
    }
}
